package spring.demo.security.utils;

import org.springframework.context.ApplicationContext;

/**
 *
 * @author td
 * @date 2017/10/11
 */
public class Util {
    private static ApplicationContext applicationContext;

    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    public static void setApplicationContext(ApplicationContext applicationContext) {
        Util.applicationContext = applicationContext;
    }

    public static <T> T  getBean(Class<T> clzz) {
        return applicationContext.getBean(clzz);
    }
}
